<%@ include file="/WEB-INF/jsp/common/include.jsp" %>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="adminLayout.tiles">
  <tiles:putAttribute name="pageTitle">Datastore Viewer</tiles:putAttribute>
  <tiles:putAttribute name="adminDatastoreTab" cascade="true">selected</tiles:putAttribute>
  <tiles:putAttribute name="body" cascade="true">
    <style>
      table#datastore td {
        border: 1px solid gray;
        padding: 2px;
      }
    </style>
    <table id="datastore">
      <c:forEach var="entity" items="${entities}" varStatus = "status">
        <c:if test="${status.first}">
          <thead>
            <tr>
              <td>
                Id
              </td>
              <c:forEach var="property" items="${entity.properties}">
                <td>
                  <c:out value="${property.key}"/>
                </td>
              </c:forEach>
            </tr>
          </thead>
        </c:if>
        <tr>
          <td>
            ${entity.key.id}
          </td>
          <c:forEach var="property" items="${entity.properties}">
            <td>
              <c:out value="${property}"/>
            </td>
          </c:forEach>
        </tr>
      </c:forEach>
    </table>
  </tiles:putAttribute>
</tiles:insertDefinition>